package com.hhp.cloud.shop.auth.feign;

import com.hhp.cloud.shop.auth.vo.MemberAuthVo;
import com.hhp.cloud.shop.auth.vo.UmsMemberVo;
import com.hhp.cloud.shop.common.core.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Description: 会员远程服务
 * @author: hhp
 * @date: 2021/11/23 17:27
 */
@FeignClient(name = "shop-member", contextId = "member")
public interface MemberFeignService {

    /**
     * @Description: 根据openid获取会员信息
     * @author: hhp
     * @Param: * @param openid  
     * @return: * @return  
     * @date 2021/11/24 9:48
     */
    @GetMapping("/app-api/v1/members/openid/{openid}")
    R<MemberAuthVo> loadUserByOpenId(@PathVariable("openid") String openid);

    /**
     * @Description: 添加会员
     * @author: hhp
     * @Param: * @param member
     * @return: * @return
     * @date 2021/11/24 9:49
     */
    @PostMapping("/app-api/v1/members")
    R<Long> add(@RequestBody UmsMemberVo member);

    /**
     * @Description: 根据手机号获取会员信息
     * @author: hhp
     * @Param: * @param mobile
     * @return: * @return
     * @date 2021/11/24 9:49
     */
    @GetMapping("/app-api/v1/members/mobile/{mobile}")
    R<MemberAuthVo> loadUserByMobile(@PathVariable("mobile") String mobile);
}
